package com.example.service;

import com.example.domain.User;
import com.example.domain.UserExample;
import com.example.mapper.UserMapper;
import org.apache.ibatis.session.RowBounds;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 文科 on 2015/11/21.
 */
@Component
public class UserService {

    @Resource
    UserMapper userMapper;

    @Cacheable(value = "userCache")
    public List<User> getUsers(Integer start,Integer limit){
        return userMapper.selectByExampleWithRowbounds(new UserExample(),new RowBounds(start,limit));
    }

}
